﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;

namespace QuanLyKhachSan
{
    public partial class DanhSachPhong : Form
    {
        public DanhSachPhong()
        {
            InitializeComponent();
        }

        private void btThoat_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Chắc chắn muốn thoát ???", "Warning !!!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                this.Close();
        }

        private void DanhSachPhong_Load(object sender, EventArgs e)
        {
            List<PhongDTO> dsSinhVien = PhongBUS.layDSPhong();
            for (int i = 0; i < dsSinhVien.Count; i++)
            {
                //lvDSPhong.Rows.Add(dsSinhVien[i].MaPhong, dsSinhVien[i].TenPhong, dsSinhVien[i].LoaiPhong.TenLoaiPhong, dsSinhVien[i].TenPhong, dsSinhVien[i].TinhTrang);
                ListViewItem LVI = new ListViewItem(new String[] { (i+1).ToString() , dsSinhVien[i].TenPhong, dsSinhVien[i].LoaiPhong.TenLoaiPhong, dsSinhVien[i].DonGia.DonGia.ToString(), dsSinhVien[i].TinhTrang.ToString() });
                lvDSPhong.Items.Add(LVI);
            }
        }
    }
}
